#include <at89x52.h>
void TimerOInit(void)
{
TH0=0x0f0;
TL0=0x05f;
TMOD=0x01;
TCON=0x10;
IE=0x82;
}
unsigned char Tcount=0;
void time0_over() interrupt 1
{
Tcount++;
TH0=0xf0;
TL0=0x0;
}
void main()
{
TimerOInit();
while (1)
{
           if(Tcount==4)
           {P1^=0xff;}
           if(Tcount==2)
           {P2=0xff;}
}
}
